package com.example.oasystem.dao.role;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.example.oasystem.entity.list.AoaSysMenu;
import com.example.oasystem.entity.page.Page;
import com.example.oasystem.entity.role.AoaRole;
import com.example.oasystem.entity.role.AoaRolePowerList;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Repository
public interface AoaRoleDao extends BaseMapper<AoaRole> {


    List<AoaRole> selectByRole(Long roleId);

    List<AoaRole> selectRolePowerMenu();

    List<AoaRole> selectRole(@Param("page") Page page,@Param("roleName")String roleName);

    List<AoaSysMenu> selectRoleMenu(@Param("roleid")long roleid,@Param("page")Page page);

    AoaRole selectOneRole(@Param("roleid")long roleid);

    List<AoaSysMenu> selectPowerMenu(long roleId);

    AoaRole selectRoleName(@Param("roleName")String roleName);

    int addRole(@Param("aoaRole") AoaRole aoaRole);

    int updateRole(@Param("aoaRole") AoaRole aoaRole);

    void delRole(@Param("roleId") long roleId);

    void insertPower(@Param("list")List<AoaSysMenu> list,long roleId);

    void deletePower(@Param("roleId")long roleId);

    int updateRolePower(@Param("isShow") int isShow, @Param("menuId")long menuId, @Param("roleId")long roleId);

}